package china.accountinghelper.model;

import java.io.Serializable;

public class ModelExpenseDetail implements Serializable
{
	private static final long	serialVersionUID	= 1L;
	
//	消费明细ID
	private long mID;
//	所属消费记录ID，外键
	private long mExpenseID;
//	消费人ID，外键
	private long mConsumerID;
//	消费金额，单位为分
	private long mMoney;
	
	public ModelExpenseDetail()
	{
	    this(0, 0, 0, 0);
	}
	public ModelExpenseDetail(long pConsumerID, long pMoney)
    {
        this(0, 0, pConsumerID, pMoney);
    }
    public ModelExpenseDetail(long pConsumerID, double pMoney)
    {
        this(0, 0, pConsumerID, pMoney);
    }
    public ModelExpenseDetail(long pExpenseID, long pConsumerID, long pMoney)
    {
        this(0, pExpenseID, pConsumerID, pMoney);
    }
    public ModelExpenseDetail(long pExpenseID, long pConsumerID, double pMoney)
    {
        this(0, pExpenseID, pConsumerID, pMoney);
    }
    public ModelExpenseDetail(long pID, long pExpenseID, long pConsumerID, long pMoney)
	{
	    setID(pID);
	    setExpenseID(pExpenseID);
	    setConsumerID(pConsumerID);
	    setMoney(pMoney);
	}
	public ModelExpenseDetail(long pID, long pExpenseID, long pConsumerID, double pMoney)
	{
	    setID(pID);
	    setExpenseID(pExpenseID);
	    setConsumerID(pConsumerID);
	    setMoney(pMoney);
	}
	
	
    public long getID()
	{
		return mID;
	}
	public void setID(long pID)
	{
		this.mID = pID;
	}
	public long getExpenseID()
	{
		return mExpenseID;
	}
	public void setExpenseID(long pExpenseID)
	{
		this.mExpenseID = pExpenseID;
	}
	public long getConsumerID()
	{
		return mConsumerID;
	}
	public void setConsumerID(long pConsumerID)
	{
		this.mConsumerID = pConsumerID;
	}
	public long getMoney1()
	{
		return mMoney;
	}
	public void setMoney(long pMoney)
	{
		this.mMoney = pMoney;
	}
	public double getMoney2()
	{
	    return mMoney/100.0;
	}
	public void setMoney(double pMoney)
	{
	    mMoney = (long) pMoney*100;
	}
	
	@Override
	public int hashCode()
	{
		final int prime = 31;
		int result = 1;
		result = prime * result + (int) (mID ^ (mID >>> 32));
		return result;
	}
	
	@Override
	public boolean equals(Object obj)
	{
		if (this == obj) return true;
		if (obj == null) return false;
		if (getClass() != obj.getClass()) return false;
		ModelExpenseDetail other = (ModelExpenseDetail) obj;
		if (mID != other.mID) return false;
		return true;
	}

	
}
